package com.bawei.week.adapter

import android.graphics.Color
import android.widget.TextView
import com.bawei.lib_base.entity.VisitStatusBean
import com.bawei.week.R
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder

class VisitStatusAdapter : BaseQuickAdapter<VisitStatusBean,BaseViewHolder>(R.layout.item_visit_status){
    override fun convert(helper: BaseViewHolder, item: VisitStatusBean) {
        val status = helper.getView<TextView>(R.id.vis_status)
        status.text = item.status
        if (item.isChecked){
            status.setBackgroundResource(R.drawable.shape_selected)
            status.setTextColor(Color.BLUE)
        }else{
            status.setBackgroundResource(R.drawable.shape_item)
            status.setTextColor(Color.DKGRAY)
        }
    }
}